<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- DOC - TP SVG -->
<!--histo.xsl -->
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" indent="yes"
		encoding="UTF-8" doctype-system="http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd"
		media-type="image/svg" doctype-public="-//W3C//DTD SVG 1.0//EN" />

	<!-- Produire un fichier SVG -->
	<xsl:template match="annee">
		<svg xmlns="http://www.w3.org/2000/svg" width="auto" height="auto"
			viewBox="0 0 70 110" preserveAspectRatio="yes">
			<g>
				<xsl:variable name="style" select="document('./style.xml')" />
				<xsl:for-each select="mois">
					<xsl:variable name="num">
						<xsl:value-of select="@numero" />
					</xsl:variable>
					<xsl:variable name="height">
						<xsl:value-of select="text()" />
					</xsl:variable>
					<xsl:variable name="color">
						<xsl:value-of select="$style/style/color[$num*1]" />
					</xsl:variable>
					
					<rect x="{$num*10}" y="{100-$height}" width="10" height="{$height}"
						fill="{$color}" stroke="black" />
					<text x="{$num*10+1.5}" y="{110}" font-size="9">
						<xsl:value-of select="@numero" />
					</text>
				</xsl:for-each>
			</g>
		</svg>
	</xsl:template>
</xsl:stylesheet>
